Skip to content

[Backport 2.x] [Segment Replication] Refactor file cleanup logic and fix PIT/Scroll with remote store.#9272

Merged
mch2 merged 2 commits intoopensearch-project:2.xfrom
mch2:2.x
Aug 11, 2023
Merged

[Backport 2.x] [Segment Replication] Refactor file cleanup logic and fix PIT/Scroll with remote store.#9272
mch2 merged 2 commits intoopensearch-project:2.xfrom
mch2:2.x

Conversation

@mch2
Copy link
Copy Markdown
Member

@mch2 mch2 commented Aug 11, 2023

Manual backport of #9111 includes follow up commit to fix flaky #9245.

…with remote store. (opensearch-project#9111)

* Remove divergent commit logic with segment replication.

This change removes divergent commit paths for segrep node-node and remote store.
All replicas with segrep enabled will perform local commits and ignore any incoming segments_n file.
This changes the recovery sync with remote store to also exclude the segments_n so that only the fetched infos bytes are committed before
an engine is opened.
This change also updates deletion logic with segment replication to automatically delete when a file is decref'd to 0.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add more NRTReplicationEngineTests.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Ensure old commit files are wiped on remote store sync before we commit a new segmentInfos.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add more shard level tests.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add test ensuring commits are cleaned up on replicas.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Self review.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Use refresh level sync before recovery

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR feedback.

Signed-off-by: Marc Handalian <handalm@amazon.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
(cherry picked from commit c301544)
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/performance-analyzer.git]
Components skipped due to git failures: [https://github.com/opensearch-project/opensearch-oci-object-storage.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git]

BUILD SUCCESSFUL in 24m 56s

@mch2
Copy link
Copy Markdown
Member Author

mch2 commented Aug 11, 2023

fixed conflict here - ActionListener path updated on main with #9082

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/performance-analyzer.git]
Components skipped due to git failures: [https://github.com/opensearch-project/opensearch-oci-object-storage.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git]

BUILD SUCCESSFUL in 26m 18s

This test is specific to remote store and should not be run for node-node replication.

Signed-off-by: Marc Handalian <handalm@amazon.com>
(cherry picked from commit a33f67e)
Signed-off-by: Marc Handalian <handalm@amazon.com>
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/performance-analyzer.git]
Components skipped due to git failures: [https://github.com/opensearch-project/opensearch-oci-object-storage.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git]

BUILD SUCCESSFUL in 25m 10s

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 11, 2023

Codecov Report

Merging #9272 (b115dd1) into 2.x (c568386) will decrease coverage by 0.11%.
Report is 1 commits behind head on 2.x.
The diff coverage is 90.00%.

@@             Coverage Diff              @@
##                2.x    #9272      +/-   ##
============================================
- Coverage     70.85%   70.75%   -0.11%     
+ Complexity    57499    57443      -56     
============================================
  Files          4758     4758              
  Lines        271801   271785      -16     
  Branches      40090    40087       -3     
============================================
- Hits         192590   192296     -294     
- Misses        62700    62950     +250     
- Partials      16511    16539      +28     
Files Changed Coverage Δ
...rc/main/java/org/opensearch/index/store/Store.java 81.12% <ø> (+0.46%) ⬆️
...ch/indices/recovery/PeerRecoveryTargetService.java 57.84% <0.00%> (+4.90%) ⬆️
...in/java/org/opensearch/index/shard/IndexShard.java 69.22% <85.71%> (+0.43%) ⬆️
...rg/opensearch/index/engine/ReplicaFileTracker.java 86.11% <86.11%> (ø)
.../opensearch/index/engine/NRTReplicationEngine.java 78.08% <100.00%> (+0.37%) ⬆️
...earch/index/store/RemoteSegmentStoreDirectory.java 87.70% <100.00%> (ø)
...ices/replication/RemoteStoreReplicationSource.java 90.90% <100.00%> (+0.16%) ⬆️
.../indices/replication/SegmentReplicationTarget.java 89.00% <100.00%> (-0.72%) ⬇️

... and 482 files with indirect coverage changes

@mch2 mch2 merged commit c8471a0 into opensearch-project:2.x Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants